
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

    <table border="1">
        <tr>
            <td>姓名</td>
            <td>性别</td>
            <td>邮箱</td>
            <td>爱好</td>
            <td>出生城市</td>
            <td>操作</td>
        </tr>
        <c:forEach var="s" items="${requestScope.stuList}">
            <tr>
                <td>${s.name}</td>
                <td>${s.sex}</td>
                <td>${s.email}</td>
                <td>${s.hobby}</td>
                <td>${s.city}</td>
                <td>
                    <input type="button" value="修改" onclick="updateStu('${s.name}')"/>
                    <input type="button" value="删除" onclick="delStu('${s.name}','${page1.currPage}')"/>
                </td>
            </tr>
        </c:forEach>
        <tr><td colspan="6"><a href="TeacherServlet?method=add">添加学生信息</a></td></tr>
        <tr><td colspan="6">
            <c:if test="${page1.currPage>1}">
                <input type="button" value="上一页" onclick="fenye(${page1.currPage-1})"/>
            </c:if>
            当前是第${page1.currPage}页
            <c:if test="${page1.currPage<page1.totalPage}" >
                <input type="button" value="下一页" onclick="fenye(${page1.currPage+1})"/>
            </c:if>
        </td></tr>
        <tr><td colspan="6">
            <h1>
                <c:forEach begin="1" end="${page1.totalPage }" step="1" varStatus="status">
                    <a href="javaScript:void(0)" onclick="fenye(${status.index})">${status.index}</a>
                </c:forEach>
            </h1>
        </td></tr>
    </table>


